/*
 * 
 * 
 * @author: Oren Zamir
 */
package org.valire.usermanagement.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.valire.util.persistency.BaseEntity;

/**
 * The Class Roles.
 */
@Entity(name = "ROLES")
@Table(name = "ROLES")
public class Role extends BaseEntity{

	private static final long serialVersionUID = -4814978498601065310L;
	
	@Column(name = "ROLE_NAME")
	private String roleName;

	/**
	 * Sets the role name.
	 *
	 * @param roleName the new role name
	 */
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getRoleName() {
		return roleName;
	}

	@Override
	public boolean equals(Object obj) {
		return this.roleName.equals(((Role)obj).getRoleName());
	}

	@Override
	public String toString() {
		return "Role id : " + this.getId()+", Role name : "+this.getRoleName();
	}

}
